<template>
	<view class="wrapper index">
		<myheader>
			<div class="colum h100">
				<div class="f18">{{$t('index.yue')}}</div>
				<div class="f54 mt20 mb5 center">
					<div class="fbold mr10">{{uinfo.money}}</div>
					<image src="../../static/logo2.png" mode="widthFix" class="logo1-icon posr"></image>
					<div class="f32">ice</div>
				</div>
				<div class="income f18">{{$t('index.shou')}}</div>
			</div>
		</myheader>
		<scroll-view scroll-y="true" class="main">
			<!-- 轮播图 -->
			<div class="mt30">
				<u-swiper :list="list3" indicatorMode="dot" previousMargin="60" nextMargin="60" circular
					:autoplay="true" radius="5" bgColor="#ffffff" height="267rpx" indicator
					indicatorActiveColor="#1C49D7" indicatorInactiveColor="rgba(28, 73, 215, .2)"></u-swiper>
			</div>

			<div class="page-main">
				<!-- 链接 -->
				<div class="btheme link-box">
					<div class="center">
						<div class="icon-box center bfff">
							<image src="../../static/index1.png" mode="widthFix"></image>
						</div>
						<div class="bfff center ctheme flex1">
							<div class="flex1 nowrap f20">{{$t("index.tui")}}：{{tpaddress}}</div>
							<div class="copy-btn center cfff" @click="copyText(tpaddress)">{{$t("index.fu")}}</div>
						</div>
					</div>
					<!-- <div class="center mt20">
						<div class="icon-box center bfff">
							<image src="../../static/index2.png" mode="widthFix"></image>
						</div>
						<div class="bfff center ctheme flex1">
							<div class="flex1 nowrap f20">{{$t("index.xiu")}}：https://h5.bnbait.com/#/?addr....</div>
							<div class="copy-btn center cfff" @click="show=true">{{$t("index.gai")}}</div>
						</div>
					</div> -->
				</div>
				<!-- <div class="btheme time center mt20">
					<div class="f26 cfff">{{$t("index.dao")}}</div>
					<div class="bfff time-box center">
						<u-count-down :time="30 * 60 * 60 * 1000" format="HH:mm:ss"></u-count-down>
					</div>
				</div> -->
				<div class="btheme mt20">
					<div class="center space-around cfff mt10 mb30">
						<div class="align-end" @click="index=0">
							<image src="../../static/index3.png" mode="widthFix" class="nav-icon"></image>
							<div class="f26">{{$t("index.lianhe")}}</div>
						</div>
						<div class="align-end" @click="index=1">
							<image src="../../static/index4.png" mode="widthFix" class="nav-icon"></image>
							<div class="f26">{{$t("index.zhuan")}}</div>
						</div>
					</div>
					<!-- 联合创始团队 -->
					<div class="team-list" v-show="index==0">
						<div class="bfff center team-box bfff mb20" v-for="v in info.lhcstd">
							<image src="../../static/index5.png" mode="widthFix" class="team-icon mr10"></image>
							<div class="flex1 f24 nowrap ctheme">{{v}}</div>
						</div>
					</div>
					<!-- 专家介绍 -->
					<div class="bfff team-box bfff mb20" v-show="index==1">
						<div class="f24 ctheme">{{info.zajs}}</div>
					</div>
				</div>
			</div>

		</scroll-view>
		<!-- 修改邀请人 -->
		<u-modal :show="show" closeOnClickOverlay="true" :title="$t('index.yaoqing')" @confirm="confirm"
			@close="show=false">
			<u-input type="text" :placeholder="$t('placeholder')" />
		</u-modal>
	</view>
</template>

<script>
	import {
		imgUrl
	} from '@/utils/config.js'
	import myheader from '@/components/myheader/myheader'
	export default {
		data() {
			return {
				loading: false,
				show: false,
				index: 0,
				list3: [],
				uinfo: uni.getStorageSync('uinfo'),
				info: {}
			}
		},
		components: {
			myheader
		},
		computed: {
			tpaddress(){
				return window.location.host +'/h5/index.html/#/pages/login/login?recommended_address='+ this.info.tpaddress
			}
		},
		onShow() {
			// 未登录前往登陆页面
			if (!uni.getStorageSync('uinfo')) {
				this.open('../login/login', 3)
			} 
			// 未初始化初始化
			// if (!this.connected) {
			// 	this.initWeb3((tpaddress) => {})
			// }
		},
		onLoad() {
			this.info = uni.getStorageSync('uinfo')
			this.getBanner()
			this.getInfo()
		},
		methods: {
			// 查询首页
			getInfo() {
				this.$http('user/info').then(r => {
					this.info = r
				})
			},
			// 查询轮播图
			getBanner() {
				this.$http('index/banner').then(r => {
					this.list3 = r.map((item) => {
						return imgUrl + item.image
					})
				})
			},
			confirm() {
				if (this.address == '') {
					this.sToast(this.$t("placeholdererror"))
				}
			}
		}
	}
</script>

<style lang="scss">
	.team-box {
		box-shadow: 3rpx 1rpx 6rpx 1rpx rgba(160, 24, 102, .2);
		border-radius: 20rpx;
		padding: 10rpx 17rpx;

		.team-icon {
			width: 47rpx;
			height: 49rpx;
			// box-shadow: 2rpx 6rpx 6rpx 6rpx rgba(160, 24, 102, .2);
		}
	}

	.nav-icon {
		width: 36rpx;
		height: 36rpx;
		margin-right: 10rpx;
	}

	.time-box {
		border-radius: 17rpx 17rpx 17rpx 17rpx;
		width: 220rpx;
		margin-left: 50rpx;

		:deep(.u-count-down__text) {
			color: #3476FE;
			font-size: 30rpx;
			letter-spacing: 4rpx;
		}
	}

	.link-box {


		.ctheme {
			padding: 0 4rpx 0 21rpx;
			border-radius: 17rpx 17rpx 17rpx 17rpx;
			height: 35rpx;
		}

		.copy-btn {
			width: 57rpx;
			height: 29rpx;
			background: #1C49D7;
			border-radius: 14rpx;
			font-size: 11rpx;
			margin-left: 68rpx;
		}

		.icon-box {
			width: 61rpx;
			height: 45rpx;
			border-radius: 15rpx;
			margin-right: 17rpx;

			image {
				width: 32rpx;
				height: 37rpx;
			}
		}
	}

	.page-main {
		padding: 60rpx 40rpx;

		.btheme {
			box-shadow: 3rpx 1rpx 6rpx 1rpx rgba(160, 24, 102, .2);
			border-radius: 20rpx;
			padding: 20rpx 17rpx;
		}
	}


	:deep(.u-swiper) {
		overflow: initial;

		.u-swiper-indicator__wrapper__dot {
			width: 20rpx;
			height: 10rpx;
			border-radius: 5rpx;
		}

		.u-swiper__indicator {
			bottom: -30rpx;
		}
	}

	.income {
		width: 365rpx;
		height: 43rpx;
		line-height: 43rpx;
		background: #FFFFFF;
		box-shadow: 3rpx 1rpx 6rpx 1rpx rgba(160, 24, 102, .1), inset 0rpx 0rpx 6rpx 0rpx rgba(0, 0, 0, .5);
		border-radius: 16rpx;
		padding-left: 70rpx;
		color: #1D47C0;
	}

	.logo1-icon {
		width: 27rpx;
		height: 27rpx;
		top: -10rpx;
	}
</style>